<template>
	<uni-nav-bar
		v-bind="$attrs"
		:border="border"
		:left-icon="leftIcon"
		@click-left="back"
	/>
</template>

<script setup>
const props = defineProps({
	border: {
		type: Boolean,
		default: false
	},
	leftIcon: {
		type: String,
		default: 'left'
	},
	cover: {
		type: Boolean,
		default: false
	}
})

const emits = defineEmits(['back'])
const back = () => {
	if (!props.leftIcon) return
	if (!props.cover) {
		uni.navigateBack({ delta: 1 })
	}
}
</script>

<style lang="scss">
:deep(.uni-navbar__header) {
	padding: 7px 6px;
	box-sizing: border-box;
}
:deep(.uni-navbar__header-btns-left) {
	align-items: baseline;
}
:deep(.uniui-left) {
	font-size: 25px !important;
}
:deep(.uni-nav-bar-text) {
	font-size: 16px;
	font-weight: bold;
}
</style>
